#include "stdio.h"
#include "string.h"


int chtoint(char ch)
{
	int a;
	switch (ch)
	{
		case '_': a=0;break;
		case 'a': a=1;break;
		case 'b': a=2;break;
		case 'c': a=3;break;
		case 'd': a=4;break;
		case 'e': a=5;break;
		case 'f': a=6;break;
		case 'g': a=7;break;
		case 'h': a=8;break;
		case 'i': a=9;break;
		case 'j': a=10;break;
		case 'k': a=11;break;
		case 'l': a=12;break;
		case 'm': a=13;break;
		case 'n': a=14;break;
		case 'o': a=15;break;
		case 'p': a=16;break;
		case 'q': a=17;break;
		case 'r': a=18;break;
		case 's': a=19;break;
		case 't': a=20;break;
		case 'u': a=21;break;
		case 'v': a=22;break;
		case 'w': a=23;break;
		case 'x': a=24;break;
		case 'y': a=25;break;
		case 'z': a=26;break;
		case '.': a=27;break;
	}
	return a;
}


char numtoch(int a)
{
	char ch;
	switch (a)
	{
		case 0:ch='_';break;
		case 1:ch='a';break;
		case 2:ch='b';break;
		case 3:ch='c';break;
		case 4:ch='d';break;
		case 5:ch='e';break;
		case 6:ch='f';break;
		case 7:ch='g';break;
		case 8:ch='h';break;
		case 9:ch='i';break;
		case 10:ch='j';break;
		case 11:ch='k';break;
		case 12:ch='l';break;
		case 13:ch='m';break;
		case 14:ch='n';break;
		case 15:ch='o';break;
		case 16:ch='p';break;
		case 17:ch='q';break;
		case 18:ch='r';break;
		case 19:ch='s';break;
		case 20:ch='t';break;
		case 21:ch='u';break;
		case 22:ch='v';break;
		case 23:ch='w';break;
		case 24:ch='x';break;
		case 25:ch='y';break;
		case 26:ch='z';break;
		case 27:ch='.';break;
		default : ch='A';
	}
	return ch;
}

int tqmod(int a,int b)
{
	int c;
	c=a%b;
	if (c<0) c+=b;
	return c;
}


main()
{
	int k,n,p;
	char in[80],out[80];
	int i,j,max,min;

	scanf("%d %s",&k,in);

	memcpy(out,in,sizeof(char)*80);
	while (k!=0)
	{
		memcpy(out,in,sizeof(char)*80);
		n=strlen(in);
		max=27;
		min=0;
		for (i=0;i<n;++i)
		{
			p=tqmod(k*i,n);
			max-=i;
			min-=i;
			j=chtoint(in[i]);
			/*while (j>max) j-=28;
			while (j<min) j+=28;*/
			j+=i;
			while (j>max)j-=28;
			while (j<0)  j+=28;
			out[p]=numtoch(j);
		}
		printf("%s\n",out);
		scanf("%d %s",&k,in);
	}
}